/******************************************************************************/
/*  Class SETPOINT                                                            */
/*  PO: S. Maslyakov, rusoil.9@gmail.com                                      */
/*                                                                            */
/*  Revision:     1.0                                                         */
/*  Date:         2011/03/14 15:30:33                                         */
/******************************************************************************/


#ifndef __SETPOINT_H
#define __SETPOINT_H


#include "data_types.h"
#include "Fmem_layer\fmem_layer.h"
#include "Setpoint\setpoint_def.h"


//==============================================================================
//  Class SETPOINT
//==============================================================================
class SETPOINT
{

public:
  static void Init_Setpoint();
  static void Init_setpoint_task();
  static void * Get_setpoint_event();
  static void Activate_setpoint_task();

private:
  static void Init_rtos_part();
  static void Task_setpoint(void * par);
  static void ConvertSignData(const uint32_t _type, __UNION_DWORD * const _pData);
  static uint32_t GetDataSize(const uint32_t _dataType);
  static uint32_t ReadRec(__REC_SETPOINT * const _pRec, const uint32_t _index);

  static bool_t ReadArg(const uint32_t _addr,
                        const uint32_t _dataSize,
                        __UNION_DWORD * const _pDst);

  static uint32_t PerfomCompare(const __REC_SETPOINT * const _pRec,
                                const __UNION_DWORD * const _cell,
                                const uint32_t _index);

  static bool_t CompareMore(const uint32_t _type,
                            const __UNION_DWORD * const _pCell,
                            const __UNION_DWORD * const _pSpMax);

  static bool_t CompareLess(const uint32_t _type,
                            const __UNION_DWORD * const _pCell,
                            const __UNION_DWORD * const _pSpMin);

  static __TOOLS_SETPOINT m_tools[MEM_SETPOINT_NUM];

};
//==============================================================================
//==============================================================================


#endif